package com.tank.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.tank.bean.User;
import com.tank.dao.BuddyDAO;
import com.tank.service.BuddyService;
import com.tank.util.Pager;

@Service("buddyService")
public class BuddyServiceImpl implements BuddyService {
	
	@Autowired
	@Qualifier("buddyDao")
	BuddyDAO dao;
	
	public Pager findFansList(User master) {
		return dao.findFansList(master);
	}

	public Pager findFollowsList(User master) {
		
		
		return dao.findFollowsList(master);
	}

	public boolean add(User master, User target) {
		return dao.add(master, target);
	}

	public boolean remove(User master, User target) {
		return dao.remove(master, target);
	}

	public Pager findOthersFansList(User master) {
		return dao.findBuddyList(master,"fans");
	}
	
	public Pager findOthersFollowsList(User master) {
		return dao.findBuddyList(master,"follows");
	}
	
	public Pager findBuddyList(User master) {
		//return dao.findBuddyList(master,"find");
		return dao.doFind(master);
	}

}
